package com.my.chapter20;

import net.mindview.util.OSExecute;

import java.util.HashMap;

public class practice9 {
    HashMap<String,Integer> testObject =
            new HashMap<String,Integer>();
    @net.mindView.atunit.Test void initialization() {
        assert testObject.isEmpty();
    }
    @net.mindView.atunit.Test void _containsValue() {
        testObject.put("one", 1);
        assert testObject.containsValue(1);
    }
    @net.mindView.atunit.Test void _containsKey() {
        testObject.put("one", 1);
        assert testObject.containsKey("one");
    }
    @net.mindView.atunit.Test void _remove() {
        testObject.put("one", 1);
        testObject.remove("one");
        assert testObject.isEmpty();
    }
    @net.mindView.atunit.Test void _get() {
        testObject.put("one", 1);
        assert testObject.get("one") == 1;
    }
    @net.mindView.atunit.Test void _size() {
        testObject.put("one", 1);
        testObject.put("two", 2);
        assert testObject.size() == 2;
    }
    @net.mindView.atunit.Test void _clear() {
        testObject.put("one", 1);
        assert !testObject.isEmpty();
        testObject.clear();
        assert testObject.isEmpty();
    }

    public static void main(String[] args) throws Exception {
        OSExecute.command("java " +
                " net.mindView.atunit.AtUnit practice9");
    }
}
